package net.sparrow.gui;

import net.sparrow.gui.drawing.DrawManager;
import net.sparrow.gui.drawing.SpScreenCoord;
import net.sparrow.gui.drawing.font.SpFontNew;
import net.sparrow.gui.drawing.font.SpFontNew.SpFontX;
import net.sparrow.gui.drawing.font.SpFontNew.SpFontY;
import net.sparrow.gui.drawing.font.UnicodeFontRenderer;

public class GuiService {

	private DrawManager drawManager = new DrawManager();
	

	UnicodeFontRenderer smFont;
	UnicodeFontRenderer medFont;
	UnicodeFontRenderer lgFont;
	
	UnicodeFontRenderer b_smFont;
	UnicodeFontRenderer b_medFont;
	UnicodeFontRenderer b_lgFont;
	
	public GuiService() {
		smFont = new UnicodeFontRenderer(new java.awt.Font("Segoe UI Light", java.awt.Font.PLAIN, 25));
		medFont = new UnicodeFontRenderer(new java.awt.Font("Segoe UI Light", java.awt.Font.PLAIN, 40));
		lgFont = new UnicodeFontRenderer(new java.awt.Font("Segoe UI Light", java.awt.Font.PLAIN, 55));
		
		b_smFont = new UnicodeFontRenderer(new java.awt.Font("Segoe UI", java.awt.Font.PLAIN, 25));
		b_medFont = new UnicodeFontRenderer(new java.awt.Font("Segoe UI", java.awt.Font.PLAIN, 40));
		b_lgFont = new UnicodeFontRenderer(new java.awt.Font("Segoe UI", java.awt.Font.PLAIN, 55));
	}
	
	public DrawManager draw() {
		return drawManager;
	}
	
	public void drawString(String text, SpScreenCoord coord, SpFontSize size, SpFontType type, SpFontX xAln, SpFontY yAln) {
		if(type == SpFontType.BOLD) {
			
			if(size == SpFontSize.SMALL) {
				b_smFont.drawString(text, coord, xAln, yAln);
				return;
			}
			if(size == SpFontSize.MEDIUM) {
				b_medFont.drawString(text, coord, xAln, yAln);
				return;
			}
			
			if(size == SpFontSize.LARGE) {
				b_lgFont.drawString(text, coord, xAln, yAln);
				return;
			}	
			return;
		}
		
		if(size == SpFontSize.SMALL) {
			smFont.drawString(text, coord, xAln, yAln);
			return;
		}
		if(size == SpFontSize.MEDIUM) {
			medFont.drawString(text, coord, xAln, yAln);
			return;
		}
		
		if(size == SpFontSize.LARGE) {
			lgFont.drawString(text, coord, xAln, yAln);
			return;
		}	
	}
	
	
	
	
	public enum SpFontType {
		PLAIN,
		BOLD,
		EX_BOLD
	}
	
	public enum SpFontSize {
		SMALL(15),
		MEDIUM(30),
		LARGE(45);
		
		public int size;
		SpFontSize(int sz) {
			size = sz;
		}
	}
	
}
